Tourr: overview

The computation of a tour involves two major stages: the generating and interpolating stage. Given a current projection basis and its corresponding index value, the generator aims to try to find a better basis with higher index value through optimisation and the better basis found is called the target basis. The interpolator interpolates the current and target basis geodesically. Currently there are three optimisers in the tourr package: search_better(), search_better_random() and search_geodesic().

Global Object

To understand the searching path of the basis in the optimisation, a global object that records all the bases, index value and auxiliary information would be useful. The animate_dist() function has been modified to result a tibble object contains all the information mentioned above, on top of its animated visualisation display.

Demo

Here I present a demonstration of how to use the modified version of tourr package and principle component analysis to understand the optimisation searching path. Simulated data is generated using 4 random variables (x1, x8, x9, x10) and a bi-modal distribution (x2). The histogram of the five variables are presented below.

search_geodesic()

Using the search_geodesic() optimiser, the first five rows of the global object generated from the tour is shown below.

## # A tibble: 6 x 7
##   basis             index_val tries info              loop col   method  
##   <list>                <dbl> <dbl> <chr>            <dbl> <chr> <chr>   
## 1 <dbl[,1] [5 × 1]>     0.738     1 start               NA x2    geodesic
## 2 <dbl[,1] [5 × 1]>     0.738     1 direction_search     1 x2    geodesic
## 3 <dbl[,1] [5 × 1]>     0.738     1 direction_search     1 x2    geodesic
## 4 <dbl[,1] [5 × 1]>     0.738     1 direction_search     1 x2    geodesic
## 5 <dbl[,1] [5 × 1]>     0.738     1 direction_search     1 x2    geodesic
## 6 <dbl[,1] [5 × 1]>     0.738     1 direction_search     1 x2    geodesic

Visualisation tools could help to visually inspect the bases from the tour. Using principle component analysis, we obtain the 2D projection of the 5D basis. The next three visualisations plot the first two principle components and allow us to draw some insights on the search_geodesic routine.

search_better()

search_better_random()